package org.anyin.gitee.cloud.lib.core.enums;

import lombok.Getter;
import org.anyin.gitee.cloud.lib.core.exceptions.CommonException;

@Getter
public enum CommonExCodeEnum {
    SUCCESS("00", "成功"),
    UNKNOWN_ERROR("COM00001", "未知错误"),
    DATA_PARSE_ERROR("COM00002", "数据解析异常"),
    SYSTEM_ERROR("COM00003", "系统异常"),
    PARAM_ERROR("COM00004", "参数异常"),
    USER_NOT_LOGIN("COM00005", "用户未登录"),
    ;

    private String code;

    private String message;

    CommonExCodeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public CommonException getException(){
        return new CommonException(this.code, this.message);
    }
}
